<!DOCTYPE html>
<html lang="en" >
<head>
    <title>Atomsk - LMP format - Pierre Hirel</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" media="screen" type="text/css" title="Default" href="./default.css" />
    <link rel="icon" href="../img/atomsk_logo.png" type="image/png" />
</head>
   
<body>

<p><a href="./index.html">Back to main menu</a></p>

<h2>Format: LMP</h2>

<p><strong>Name:</strong> LAMMPS data file</p>

<p><strong>Extension:</strong> unspecified (usually .data, Atomsk uses .lmp)</p>

<p><strong>Specification:</strong> <a href="https://lammps.sandia.gov/doc/read_data.html">LAMMPS online manual</a></p>

<p><strong>Visualization programs:</strong> <a href="http://ovito.org">OVITO</a></p>

<h4>Restrictions</h4>

<p>Atomsk can read LAMMPS data files (LMP) corresponding to all "<code>atom_style</code>", except "<code>dipole</code>" and "<code>hybrid</code>". However, all information is not read. Only the box vectors, the particles positions, the particles masses, and velocities, are read and stored by Atomsk. All other sections (like Bonds, Angles, etc.) are ignored.</p>

<p>In the section "Atoms" containing the positions of the particles, if each line ends with three integer numbers, then they are interpreted as flags giving the replica number. The particle is then translated by the corresponding vector.</p>

<p>If a "Masses" section exists before the "Atoms" section, then the particles masses are read and stored as auxiliary properties. Atomsk tries to convert the particles masses into atomic numbers to determine the chemical species of each particle. If, in a line giving the particle type and its mass, the line ends with a comment containing the keywords "core" or "shell", then Atomsk will recognize the particles of the corresponding type as cores or shells, respectively (see <a href="https://lammps.sandia.gov/doc/Howto_coreshell.html">this section of the LAMMPS manual</a> about core/shell models).</p>

<p>If a "Velocities" section exists after the "Atoms" section, then velocities are stored as auxiliary properties (vx, vy, vz). In LMP files atoms are distinguished by their "atom type" (1, 2, 3...), which Atomsk recognizes as species (H, He, Li...). These "atom types" can be replaced by atom species thanks to the <a href="./option_substitute.html">option <code>-substitute</code></a>. In addition, atom types are saved as auxiliary properties to ensure they are conserved when converting to formats that support it. This behavior can be cancelled by removing this auxiliary property with the <a href="./option_rmprop.html">option <code>-rmprop type</code></a>.</p>

<hr>

<p>Atomsk can write files to the LMP format, which can be read from a LAMMPS input file thanks to the <a href="https://lammps.sandia.gov/doc/read_data.html"><code>read_data</code> command</a>. This LMP file contains atom positions and, if they were defined, atom velocities. Beware that atomic species are replaced by LAMMPS' "atom types" (1, 2, 3...). If these atom types exist as auxiliary properties (either because they were read from an input file, or <a href="./option_properties.html">defined with the option <code>-properties</code></a>) then Atomsk will use them to write the LMP file. Otherwise atomic numbers will be replaced by increasing atom types in the order in which they appear.</p>

<p>By default each line is written with the format "<code>ID type x y z</code>", suited for the style "<code>atom_style atom</code>" in the LAMMPS input file. But if atom charges are defined (either from the input file or through the <a href="./option_properties.html">option <code>-properties</code></a>) then the output format will be "<code>ID type charge x y z</code>", assuming the use of "<code>atom_style charge</code>". For other styles one can perform an appropriate search-and-replace in the data file. Atomsk comes with <a href="./tools.html">bash scripts</a> that perform such a search-and-replace.</p>

<p>LAMMPS requires that the first vector of the supercell is aligned with the X axis, and the second vector is within the XY plane (see <a href="https://lammps.sandia.gov/doc/Howto_triclinic.html">this section of the LAMMPS manual</a> about triclinic boxes). If it is not the case Atomsk will prompt whether to realign the cell vectors or not. If accepted the realignment will apply only to the LAMMPS data file (and not to other output formats). If no alignment is performed then Atomsk will warn that some components of the cell vectors (precisely <code>H(1,2)</code>, <code>H(1,3)</code> and <code>H(2,3)</code>) cannot be written to the data file, so the geometry of the system will most likely be wrong. To make sure that the cell is always aligned it is recommended to run Atomsk with the <a href="./option_alignx.html">option <code>-alignx</code></a>.</p>

<p>If the box skew is too large (for instance if <code>|H(2,1)|&#62;0.5*H(1,1)</code>), the user will be prompted whether to reduce it before writing the data file (see the error message "<em>Triclinic box skew is too large</em>" in the <a href="https://lammps.sandia.gov/doc/Errors_messages.html">LAMMPS errors page</a>, and <a href="https://lammps.sandia.gov/doc/Howto_triclinic.html">this section of the LAMMPS manual</a> about triclinic boxes). To make sure that the box is never skewed it is recommended to run Atomsk with the <a href="./option_unskew.html">option <code>-unskew</code></a>.</p>

<p>If shells exist in the system (in the sense of an ionic core-shell model), then Atomsk will write the corresponding information, as specified in <a href="https://lammps.sandia.gov/doc/Howto_coreshell.html">this section of the LAMMPS manual</a>. The number of atoms actually includes the total number of cores and shells. The number of bonds and bond types is also written. A section "<code>Masses</code>" gives the masses of cores and shells. The mass of cores are those of the most common isotopes as provided by the <a href="http://www.nist.gov/pml/data/periodic.cfm">National Institute of Standards and Technology (NIST)</a>; the mass of shells is defined as 1/10 of these values. Modify them manually if needed. In the section "<code>Atoms</code>", each line has the format "<code>ID molecule-ID type q x y z</code>", where q is the electric charge of the core or shell. When an ion has a shell, the position of the shell appears immediately after the position of the core (and they share the same molecule-ID).
 Finally, an additional section "<code>Bonds</code>" specifies the existing core-shell bonds.</p>

<p>When reading a LMP file containing shells, Atomsk cannot distinguish between cores and shells, so both are saved as atoms. They do however keep their atom types.</p>

<p>Note that the LMP file produced by Atomsk is just a draft, it is NOT fully set for a simulation. Other atom properties (masses...) and parameters (interatomic potential, etc.) are assumed to be set in the LAMMPS input script.</p>



<h4>Examples</h4>

<ul>
<li><code class="command">atomsk my_system.cfg lmp</code>
<p>This will read the file <code>my_system.cfg</code>, and convert it to <code>my_system.lmp</code>.</p></li>


<li><code class="command">atomsk my_system.cfg -alignx -unskew lmp</code>
<p>This will read the file <code>my_system.cfg</code>, <a href="./option_alignx.html">align the cell vectors</a>, <a href="./option_unskew.html">reduce the skewness</a> of the cell, and write the final result to <code>my_system.lmp</code>.</p></li>
</ul>





<p><a href="./index.html">Back to main menu</a></p>

</body>

</html>
